package com.hy.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hy.domain.GameGobangRecord;
import com.hy.domain.dto.R;
import com.hy.service.GameGobangRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("game")
public class GameController {
    @Autowired
    private GameGobangRecordService gobangRecordService;

    @GetMapping("/list/{id}")
    public R listPageByUser(@PathVariable Long id, int page, int size) {
        final IPage iPage = gobangRecordService.listPageByUser(id, page, size);
        return R.ok(iPage);
    }
}
